using System;
using System.Xml;

namespace XmlObjects.XmlWriter
{
	public class BasicXmlWriter : XmlWriterBase
	{
		public BasicXmlWriter(ElementToPropertyMap elementToPropertyMap) : base(elementToPropertyMap)
		{
		}

		public override void Append(object value, XmlNode node)
		{
			elementToPropertyMap.AppendNodeTo(node, value.GetType()).InnerXml = value.ToString();
		}

		public override void WriteLocal(object obj, XmlNode node)
		{
			node.InnerXml = obj.ToString();
		}
	}
}